<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/amazeui.min.css" />
    <link rel="stylesheet" href="css/index_2.css" />
    <title>库存记录</title>
</head>

<body style="background: #fff;">
    <!--头部-->
    <header class="am-u">
        <div class="am-u-sm-12 head_nav" style="margin:0;">
            <div class="am-u-sm-2 am-vertical-align">
                <a href="generation.html">
                    <img src="img/return@2x.png" class="am-vertical-align-middle" alt="" />
                </a>
            </div>
            <div class="am-u-sm-8 head_text">
                库存记录
            </div>
            <div class="am-u-sm-2">

            </div>
        </div>
    </header>
    <!--修改密码输入框-->
    <div style="clear:both"></div>
    <div style="padding: 15px;">
        <div class="am-u" id="kc_list">
            <!--				<div class="am-u-sm-12" style="padding:0px;background: #fff;border-bottom: 1px solid #BFBFBF;margin-bottom:5px;">
					<div class="am-u-sm-9" style="font-size: 13px;padding: 0;">
						<span>生成激活码</span>
						<p style="margin-bottom: 1rem;margin-top: 1rem;">2017年12月26日14时27分20秒</p>
					</div>
					<div class="am-u-sm-3" style="text-align: right;">
						<span>+1</span>
					</div>
				</div>-->
        </div>
    </div>
    <script src="js/jquery-1.11.3.js"></script>
    <script src="js/loading.js"></script>
    <script>
        var token1 = sessionStorage['token'];
        var method1 = "InvitationCode|tranfer_list";
        $.ajax({
            type: 'POST',
            url: "http://www.rice.com/app/api/h5_access",
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            datatype: "JSON",
            data: {
                method: method1,
                token: token1
            },
            success: function (data) {
                var data1 = JSON.parse(data);
                console.log(data1);
                if (data1.status === 1) {
                    var html = "";
                    for (var i in data1.data.list) {
                        var hh = data1.data.list[i].add_time;
                        var date = new Date(hh * 1000);
                        var Y = date.getFullYear() + '年';
                        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() +
                            1) + '月';
                        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日';
                        var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时';
                        var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) +
                            '分';
                        var s = date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds() +
                            '秒';
                        html +=
                            "<div class='am-u-sm-12' style='padding:0px;background: #fff;border-bottom: 1px solid #BFBFBF;margin-bottom:5px;'><div class='am-u-sm-9' style='font-size: 13px;padding: 0;'>";
                        if (data1.data.list[i].type_name == "转让") {
                            html += "<span>" + data1.data.list[i].type_name + "</span><span>-" + data1.data
                                .list[i].to_login_name + "</span>";
                        } else {
                            html += "<span>" + data1.data.list[i].type_name + "</span>";
                        }

                        html += "<p style='margin-bottom: 1rem;margin-top: 1rem;'>" + Y + M + D + h + m + s +
                            "</p>";
                        html += "</div><div class='am-u-sm-3' style='text-align: right;'>";
                        if (data1.data.list[i].user_type == 2) {
                            html += "<span>" + "-" + data1.data.list[i].code_num + "</span></div></div>";
                        } else {
                            html += "<span>" + "+" + data1.data.list[i].code_num + "</span></div></div>";
                        }
                    }
                    if (html == "") {
                        $("#kc_list").html(
                            "<div style='width:60%;margin:20px 20%;clear:both;'><img src='img/roun.png' style='width:100%;'></div>"
                        );
                        $(".tcdPageCode").css("display", "none");
                    } else {
                        $("#kc_list").html(html);
                    }
                } else if (Number(data1.status) == 2) {
                    alert(data1.message);
                    window.location.href = "login.html";
                } else {
                    alert(data1.message);
                }
            }
        });
    </script>
</body>

</html>